package ru.inse.core.domain.dict;

import ru.inse.core.domain.BaseEntity;



public class Place
    extends BaseEntity
{
    
    
    private String name;

    private PlaceType type;

    private Long cityId;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public PlaceType getType()
    {
        return type;
    }

    public void setType(PlaceType type)
    {
        this.type = type;
    }

    public Long getCityId()
    {
        return cityId;
    }

    public void setCityId(Long cityId)
    {
        this.cityId = cityId;
    }

    @Override
    public boolean equals(Object o)
    {
        if (!super.equals(o))
        {
            return false;
        }
        Place other = (Place)o;
        return equals(getCityId(), other.getCityId()) && equals(getType(), other.getType())&& equals(getName(), other.getName());
    }

    @Override
    public int hashCode()
    {
        int hash = 7;
        hash = accumulateHashCode(hash, getCityId());
        hash = accumulateHashCode(hash, getType());
        hash = accumulateHashCode(hash, getName());
        return hash;
    }

    @Override
    protected void addCustomFieldForToString(StringBuilder sb)
    {
        addFieldToStringBuffer(sb, "name", getName());
        addFieldToStringBuffer(sb, "type", getType());
    }
}
